#!/usr/bin/env ruby
require './atmos_mgmt.rb'
require 'test/unit'



class TestAtmosSubMgmt < Test::Unit::TestCase

  def setup
    @sm =SubtenantMgmt.new("whitewater", "whitewateradmin", "password", "https://10.245.35.161","local")
  end

  def test_create_sub
    name ="TESTINGSUBTENANTIFYOUNAMEDYOURSTHISYOURBADATLIFE"

    results = @sm.deleteSubtenant(name)
    print results.to_s + "\n"
end
  def oth
    print @sm.createSubtenant(name)
    success=false
    @sm.listSubtenants().each { |s|
      if(s == name)
        success=true
      end
    }
    assert(success)

    @sm.listSubtenants().each { |s|
      print s + "\t" + name + "\n"
      assert(s != name)
    }

  end

end

class Somthingelse
  def test_rename_subtenants
    @sm.listSubtenants().each { |subs|
    }
  end

  def test_read_subtenants
    @sm.listSubtenants().each { |subs|
      xml = @sm.readSubtenants(subs)
      xml.elements.each('subtenant/name') { |rsubs| 
        assert(subs == rsubs.text)
      }
    }
  end    

  def test_list_subtenants
    @sm.listSubtenants().each { |s| p s}
  end

end




